package top.lingkang.finalsession.javax;

import top.lingkang.finalsession.FinalSessionConfig;
import top.lingkang.finalsession.core.FinalGenerateSession;

import javax.servlet.http.HttpServletRequest;


/**
 * @author lingkang
 * Created by 2022/1/27
 */
public class GenerateSessionJavax implements FinalGenerateSession<HttpServletRequest, FinalSession> {

    @Override
    public FinalSession generateSession(HttpServletRequest request, FinalSessionConfig config) {
        String id = config.getIdGenerate().generateId(request, config);
        return new FinalSession(request.getServletContext(), id);
    }
}
